import sys
from app.common.classes import *
from app.common.storage import *
from app.common.utils import *
from app.common.menu import *

def main():
	lodger = Lodger(RestStorage("lodger1"), getConsoleIO)

	menu = Menu()
	
	@menu.add_handler("Show lodger")
	def showLodger():
		lodger.output()

	@menu.add_handler("Add item")
	def addItem():
		lodger.processItem(0)

	@menu.add_handler("Edit item")
	def editItem():
		lodger.processItem()

	@menu.add_handler("Delete item")
	def deleteItem():
		lodger.deleteItem()

	@menu.add_handler("Clean")
	def deleteItem():
		lodger.clean()

	@menu.add_handler("Exit")
	def exit():
		lodger.store()

	menu.run()
		
main()
